import { Router } from 'express';
import User from '../models/auth.js';
import expessjoi from '@escook/express-joi'
import { reg_login_schema } from '../schema/auth.js'

const router = Router();
router.post('/register',expessjoi(reg_login_schema), User.register)

router.post('/login',expessjoi(reg_login_schema), User.login)

router.get('/logout:id', (req, res) => {
  /**
   * 1. 清除 session
   * 2. 清除 cookie
   * 3. 重定向到登录页
   */
})


export default router